﻿<Window x:Class="ActiveOnline.WinMainServer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
        xmlns:controls="clr-namespace:Share;assembly=Share"
    Title="Window1" >
    <Grid Name="Grid_Root">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TabControl>
            <TabItem Header="Active Client">
                <ListView Name="ListView_clients" Grid.Column="0" Grid.Row="0" 
                              ItemsSource="{Binding Path=Clients}"
                              SelectionMode="Single">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn DisplayMemberBinding="{Binding ComputerName}">
                                <GridViewColumn.Header>
                                    <TextBlock Text="Computer Name"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn DisplayMemberBinding="{Binding ClientCode}">
                                <GridViewColumn.Header>
                                    <TextBlock Text="HDD Number"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn Header="IP Address" DisplayMemberBinding="{Binding IPAddress}"/>

                            <GridViewColumn Header="Create Date" DisplayMemberBinding="{Binding CreateDate}"/>
                            <GridViewColumn Header="Supplier Name" DisplayMemberBinding="{Binding SupplierName}"/>
                            <GridViewColumn Header="Supplier Email" DisplayMemberBinding="{Binding SupplierEmail}"/>
                            <GridViewColumn Header="Supplier Phone" DisplayMemberBinding="{Binding SupplierPhone}"/>
                            <GridViewColumn Header="Supplier Address" DisplayMemberBinding="{Binding SupplierAddress}"/>
                            
                            <GridViewColumn >
                                <GridViewColumn.Header>
                                    <TextBlock Text="Registered"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsAgreeRegister}"      VerticalAlignment="Center" IsEnabled="False" />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>

                            <GridViewColumn >
                                <GridViewColumn.Header>
                                    <TextBlock Text="Actived"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox IsChecked="{Binding IsActive}"      VerticalAlignment="Center"  />
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView>
                    </ListView.View>
                </ListView>
            </TabItem>
            <TabItem Header="Message for Client">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <ListView Name="ListView_clientMessages" Grid.Column="0" Grid.Row="0" 
                              ItemsSource="{Binding Path=ClientMessages}"
                              SelectionMode="Single" SelectedItem="{Binding Path=ClientMessageSelected}">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn DisplayMemberBinding="{Binding ComputerName}">
                                <GridViewColumn.Header>
                                    <TextBlock Text="Computer Name"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn DisplayMemberBinding="{Binding ClientCodeOfClient}">
                                <GridViewColumn.Header>
                                    <TextBlock Text="HDD Number"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn DisplayMemberBinding="{Binding Message}">
                                <GridViewColumn.Header>
                                    <TextBlock Text="Message"/>
                                </GridViewColumn.Header>
                            </GridViewColumn>
                            <GridViewColumn >
                                <GridViewColumn.Header>
                                    <TextBlock Text="At Time"/>
                                </GridViewColumn.Header>
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                       <xcdg:DatePicker SelectedDate="{Binding Path = AtTime, Mode=TwoWay}" VerticalAlignment="Center"></xcdg:DatePicker>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        
                        </GridView>
                    </ListView.View>
                </ListView>
                    <Expander Header="Detail" Grid.Row="1">
                        <Grid Name="Grid_ClientMessageDetail" DataContext="{Binding Path=ClientMessageSelected}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="Client" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Margin="2"/>
                            <controls:ComboBox_Client Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" Margin="2" SelectedValue="{Binding Path=ClientId}"
                                                      IsOnlyShowAgreeRegisterItem="True" IsShowItemAll="True" />
                            
                            <TextBlock Text="HDD Number" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="2"/>
                            <TextBox Text="{Binding Path=ClientCodeOfClient}" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" Margin="2"/>
                            
                            <TextBlock Text="Message" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center" Margin="2"/>
                            <TextBox Text="{Binding Path=Message}" Grid.Column="3" Grid.Row="0" VerticalAlignment="Center" Margin="2"/>
                            
                            <TextBlock Text="At Time" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" Margin="2"/>
                            <xcdg:DatePicker SelectedDate="{Binding Path = AtTime, Mode=TwoWay}" Grid.Column="3" Grid.Row="1" VerticalAlignment="Center" Margin="2"/>

                        </Grid>
                    </Expander>
                    <DockPanel Grid.Row="2" HorizontalAlignment="Right">
                        <Button Content="Create New" Name="Button_Create" Margin="2" MinWidth="75"></Button>
                        <Button Content="Add" Name="Button_Add" Margin="2" MinWidth="75"></Button>
                        <Button Content="Delete" Name="Button_Delete" Margin="2" MinWidth="75"></Button>
                    </DockPanel>
                </Grid>
            </TabItem>
        </TabControl>
        <DockPanel Grid.Row="1" HorizontalAlignment="Right">
            <Button Content="Save" Name="Button_Save" Margin="2" MinWidth="75"/>
                
            <Button Content="Close" Name="Button_Close" Margin="2" MinWidth="75"/>
        </DockPanel>
    </Grid>
</Window>
